package com.liu.service.impl;

import com.liu.entity.Hospital;
import com.liu.mapper.HospitalMapper;
import com.liu.service.HospitalService;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import javax.annotation.Resource;
import java.util.List;

/**
 * (Hospital)表服务实现类
 *
 * @author makejava
 * @since 2023-02-08 13:01:48
 */
@Service("hospitalServiceImpl")
@Transactional
public class HospitalServiceImpl implements HospitalService {
    @Resource
    private HospitalMapper hospitalMapper;

    @Override
    public List<Hospital> findHosByArea(Integer id) {
        return this.hospitalMapper.findHosByArea(id);
    }

    @Override
    public List<Hospital> findHos(Integer id) {
        return this.hospitalMapper.findHos(id);
    }

    @Override
    public List<Hospital> findHosByDep(Integer id) {
        return this.hospitalMapper.findHosByDep(id);
    }

    @Override
    public Hospital queryById(Integer id) {
        return this.hospitalMapper.queryById(id);
    }

    @Override
    public List<Hospital> findAll(String name,String type,String address,String grade) {
        return this.hospitalMapper.findAll(name, type, address, grade);
    }

    @Override
    public List<Hospital> queryAllByLimit(Integer pageNum, Integer pageSize, String name, String type, String address, String grade) {
        return this.hospitalMapper.queryAllByLimit(pageNum,pageSize,name,type,address,grade);
    }

    @Override
    public long count(String name, String type, String address, String grade) {
        return this.hospitalMapper.count(name,type,address,grade);
    }

    @Override
    public int insert(Hospital hospital) {
        return this.hospitalMapper.insert(hospital);
    }

    @Override
    public int insertBatch(List<Hospital> entities) {
        return this.hospitalMapper.insertBatch(entities);
    }

    @Override
    public int update(Hospital hospital) {
        return this.hospitalMapper.update(hospital);
    }

    @Override
    public int deleteById(Integer id) {
        return this.hospitalMapper.deleteById(id);
    }

    @Override
    public int deleteByIds(List<Integer> ids) {
        return this.hospitalMapper.deleteByIds(ids);
    }
}
